home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / Fight / fightingschool.swf / scripts / frame_407 / PlaceObject2_120_26 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2006-06-09  |  3KB  |  95 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.PAUSE == false)
  3.    {
  4.       if(_root.SPon == true)
  5.       {
  6.          if(this.hitTest(_root.b1.plyr1.sphit))
  7.          {
  8.             hp -= _root.SPpow;
  9.             _root.sfpunch.start();
  10.             ACTION = false;
  11.             this.char.gotoAndPlay("onhit");
  12.             if(0 >= hp or _root.b1.HITcnt == 2)
  13.             {
  14.                ACTION = false;
  15.                this.tact.ACTION = true;
  16.                this.char.gotoAndPlay("fly");
  17.             }
  18.          }
  19.       }
  20.       if(ACTION == true)
  21.       {
  22.          if(_root.b1._x < this._x and moving != "LEFT")
  23.          {
  24.             this.gotoAndPlay("n_l");
  25.             moving = "LEFT";
  26.          }
  27.          else if(this._x < _root.b1._x and moving != "RIGHT")
  28.          {
  29.             this.gotoAndPlay("n_r");
  30.             moving = "RIGHT";
  31.          }
  32.          if(moving != false and cnt < stopcnt)
  33.          {
  34.             cnt++;
  35.             if(this._x < _root.b1._x + 70 and _root.b1._x - 70 < this._x)
  36.             {
  37.                if(cnt == stopcnt - 7)
  38.                {
  39.                   this.char.gotoAndPlay("att");
  40.                }
  41.                else
  42.                {
  43.                   if(movr == true or movl == true)
  44.                   {
  45.                      this.char.gotoAndPlay("stop");
  46.                   }
  47.                   movr = false;
  48.                   movl = false;
  49.                }
  50.             }
  51.             else if(moving == "RIGHT")
  52.             {
  53.                if(this._x < _root.MAX_X)
  54.                {
  55.                   this._x += stepdis;
  56.                   if(movr == false)
  57.                   {
  58.                      this.gotoAndPlay("w_r");
  59.                      movr = true;
  60.                   }
  61.                }
  62.             }
  63.             else if(moving == "LEFT")
  64.             {
  65.                if(_root.MIN_X < this._x)
  66.                {
  67.                   this._x -= stepdis;
  68.                   if(movl == false)
  69.                   {
  70.                      this.gotoAndPlay("w_l");
  71.                      movl = true;
  72.                   }
  73.                }
  74.             }
  75.             tmptime2 = getTimer();
  76.             waittime = random(500) + 1000;
  77.          }
  78.          else
  79.          {
  80.             this.char.gotoAndPlay("stop");
  81.             movr = false;
  82.             movl = false;
  83.             tmptime1 = getTimer();
  84.             moving = false;
  85.             if(waittime < tmptime1 - tmptime2)
  86.             {
  87.                cnt = 0;
  88.                stopcnt = random(30) + 10;
  89.                moving = true;
  90.             }
  91.          }
  92.       }
  93.    }
  94. }
  95.